package com.pandy.seckill.controller;


import com.pandy.leopard.util.ResultVO;
import com.pandy.seckill.model.SeckillSku;
import com.pandy.seckill.respose.AddSeckillSkuRespose;
import com.pandy.seckill.service.ISeckillSkuService;
import com.pandy.seckill.vo.SeckillSkuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 秒杀商品表 前端控制器
 * </p>
 *
 * @author pandy
 * @since 2025-04-08
 */
@RestController
@RequestMapping("/seckill/sku")
public class SeckillSkuController {

    @Autowired
    private ISeckillSkuService seckillSkuService;

    /**
     * 添加秒杀商品
     * http://localhost:9001/seckill/sku/add
     *
      {
         "skuTitle":"苹果16-秒杀",
         "skuPrice":"5000.00",
         "costPrice":"2999.00",
         "startTime":"2025-04-10 10:00:00",
         "endTime":"2025-04-10 10:30:00",
         "stockCount":100
      }
     *
     * @param respose
     * @return
     */
    @PostMapping("/add")
    public ResultVO<SeckillSkuVO> addSeckillSku(@RequestBody AddSeckillSkuRespose respose) {
        SeckillSkuVO vo = seckillSkuService.addSeckillSku(respose);
        return ResultVO.success(vo);
    }


    // 商品详情

    // 秒杀暴露
}
